package com.rescue.mapper;

import com.github.pagehelper.Page;
import com.rescue.forum.dto.UserQueryDTO;
import com.rescue.forum.entity.UserInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserInfoMapper {
    @Select("select * from user_info where nick_name = #{nickName}")
    UserInfo getByNickName(String nickName);

    Page<UserInfo> getList(UserQueryDTO userQueryDTO);

    void update(UserInfo userInfo);

    @Select("select * from user_info where user_id = #{userId}")
    UserInfo getByUserId(Integer userId);
    @Select("select * from user_info where username = #{username}")
    UserInfo getByUserName(String username);

    void insert(UserInfo userInfo);

    @Select("select * from user_info where email = #{email}")
    UserInfo getByEmail(String email);
}
